import React from "react";
import {LdhFieldSet} from "@biz/PageCompnents";
import {LdhFormItem, LdhInput, LdhRadioGroup, LdhRadio, LdhObjListSelect} from "@biz/Components";
import BaseDetailPage from "@biz/BaseDetailPage";
import {createAction} from "../Action";
import Config from "../config";
import Store from "../Store";

const prefix = "recharge-product-detail";
export default class RechargeProductDetail extends BaseDetailPage {

    constructor(props) {
        super(props);
        this.action = createAction();
        this.config = Config(this.action);
        this.store = new Store(props, this.config, this.action);
        this.className = prefix;
    }


    renderDetail(isDetail) {
        let {loading, menus = []} = this.state;
        return <LdhFieldSet title="基本信息" btn={!isDetail} loading={loading}>

            <LdhFormItem label="产品名称" name="name" required isDetail={isDetail}>
                <LdhInput maxLength={60} showCount/>
            </LdhFormItem>
            <LdhFormItem label="售价" name="price" required isDetail={isDetail}  rules={[{pattern:window.CONFIG.REG_NUM_D2, message:"金额保留两位小数"}]}>
                <LdhInput maxLength={60} showCount/>
            </LdhFormItem>

            <LdhFormItem label="会员天数" name="days" required isDetail={isDetail}  rules={[{pattern:window.CONFIG.REG_NUM_INT, message:"天数为整数"}]}>
                <LdhInput placeholder="购买后的会员天数" />
            </LdhFormItem>
            <LdhFormItem label="副标题" name="subTitle" isDetail={isDetail}>
                <LdhInput maxLength={128} showCount/>
            </LdhFormItem>
            <LdhFormItem label="免费时间" name="freeTime" required isDetail={isDetail}  rules={[{pattern:window.CONFIG.REG_NUM_INT, message:"免费时间为整数"}]}>
                <LdhInput placeholder="每天可用的免费时间，单位分钟" />
            </LdhFormItem>


        </LdhFieldSet>

    }
}